<template>
    <div>
        <!-- 面包屑 -->
        <el-bread></el-bread>
        <!-- 添加按钮 -->
        <el-button class="addbtn" type="primary" plain size="small" @click="add" >添加</el-button>
        <!-- 表格 -->
        <Slist @sortadd="sortadd" ></Slist>
        <!-- 弹框 -->
        <Sdialog :sortInfo="sortInfo" @cancel="cancel" ref="diaRef"></Sdialog>
    </div>
</template>
<script>
import Slist from './Slist.vue'
import Sdialog from './Sdialog.vue';
export default {
    data() {
        return {
            sortInfo:{
                isShow:false,
                isAdd:true
            }
        }
    },
    methods: {
        add(){
            this.sortInfo.isShow = true
            this.sortInfo.isAdd = true
        },
        cancel(e){
            this.sortInfo.isShow=e
        },
        sortadd(id){
            this.sortInfo.isShow = true
            this.sortInfo.isAdd= false
            this.$refs.diaRef.lookup(id)
        }
    },
    mounted() { 
        console.log(this.$store);
        this.$store.dispatch('sort/GetSortInfo')
    },
    watch: {},
    computed: {},
    filters: {},
    components: {Slist,Sdialog}
}
</script>
<style scoped>
.addbtn {
    margin: 10px;
}
</style>